package primeiro.jogoandroid;

import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;

public class Inimigo extends Retangulo{

	public Inimigo(int x, int y) {
		super(x, y, 60, 60);
	}
	public void mexe(int w, int h){
		if(getY()<h){
			setY(getY()+3);
		}else{//para que os quadrados nao fiquem so caindo
			setY(-5);
			int x = (int)(Math.random()*(w-25));
		}
	}
	//class para desenhar 
	public void draw(Canvas canvas, Paint paint){
		paint.setColor(Color.RED);
		canvas.drawRect(getX(), getY(), getX()+getWidth(), getY()+getHeigth(), paint);
	}

}
